import Cookies from 'js-cookie'

const TokenKey = 'hrsaas-token'
export function getToken() {
  return Cookies.get(TokenKey)
  // 获取 token localStorage.getItem()
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
  // 设置token localStorage.setItem()
}

export function removeToken() {
  return Cookies.remove(TokenKey)
  // 移除token  localStorage.removeItem()
}

const themeKey = 'hrsaas-theme'
export function getTheme() {
  return Cookies.get(themeKey)
  // 获取 token localStorage.getItem()
}

export function setTheme(newTheme) {
  return Cookies.set(themeKey, newTheme)
  // 设置token localStorage.setItem()
}

export function removeTheme() {
  return Cookies.remove(themeKey)
  // 移除token  localStorage.removeItem()
}
